import requests
url='https://weibo.com/a/hot/realtime'
h={'Cookie':'SINAGLOBAL=2384802469268.177.1547887758400; SCF=ArZZ61Mi358pGzARl09_XDYvFL3G1jl6Cp9gHSG0cgEwqQkxdNb71cwaZUT3-wbcJf1ttQ0OmhtBzVxw4uXGpR0.; SUB=_2AkMq9UBkf8NxqwJRmPkSxW3ga4VzywHEieKcqbG_JRMxHRl-yT83qnw_tRB6AXVui6nFRcWiPL7TFRXTPhkYwrB_C0US; SUBP=0033WrSXqPxfM72-Ws9jqgMF55529P9D9WWrbKqgRbIU4ypZ4elT8G55; UOR=tech.ifeng.com,widget.weibo.com,news.ifeng.com; ULV=1585834379290:8:1:1:3612034839989.149.1585834379264:1582123253504; YF-V5-G0=b588ba2d01e18f0a91ee89335e0afaeb; Ugrow-G0=589da022062e21d675f389ce54f2eae7',
  'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36'
  }
try:
    r=requests.get(url,headers=h)
    r.encoding='utf-8'
    if r.status_code==requests.codes.ok:
        print(r.text)
    with open('Weibo hot.html','wb')as f:
        f.write(r.content)
except:
    print('Faulse!')